{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#  猎聘不同分类（公司、行业、城市）的行业数据分析\n",
    "* 数据加值宣言：本项目产出是对猎聘网挖掘的关于产品经理，用户体验的工作数据  \n",
    "  从公司、行业、城市三个角度出发，以解决对目前社会上对于这两种职业的需求情况以及行业现状的问题\n",
    "\n",
    "# 数据最小可用产品\n",
    "* MVP的数据加值：该数据产品的数据类型分为三部分（公司、行业、城市）并分别以表格的形式呈现。  \n",
    "  公司部分导出了不同类型公司中用户体验的岗位内容；  \n",
    "  行业部分导出了不同行业里对快消品相关的岗位内容；  \n",
    "  城市部分导出了首都北京对产品经理岗位的详细内容。  \n",
    "* 该内容可以帮助更好的看清或分析当前市场对这两个岗位的需求及形式\n",
    "\n",
    "# 挖掘Query参数\n",
    "\n",
    "* 该数据产品核心价值的最小可用产品还可能可以进行其他的内容对比，例如薪资等"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 基本模块\n",
    "import pandas as pd\n",
    "from requests_html import HTMLSession"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>edu</th>\n",
       "      <th>经验</th>\n",
       "      <th>薪水</th>\n",
       "      <th>时间</th>\n",
       "      <th>职称</th>\n",
       "      <th>公司地点</th>\n",
       "      <th>公司名称</th>\n",
       "      <th>链结</th>\n",
       "      <th>公司URL</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>15-25k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>机器人ros开发工程师</td>\n",
       "      <td>深圳</td>\n",
       "      <td>深圳博鹏智能科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927758683.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10005407/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>10-25k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>电机控制算法工程师</td>\n",
       "      <td>珠海-香洲区</td>\n",
       "      <td>英搏尔</td>\n",
       "      <td>https://www.liepin.com/job/1927758509.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9557666/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>10-15k·13薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>生鲜运营经理</td>\n",
       "      <td></td>\n",
       "      <td>正大食品企业(青岛)有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927757141.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8852429/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>10-30k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>储备项目营销负责人</td>\n",
       "      <td>唐山</td>\n",
       "      <td>碧桂园营销中心-天津区域(分支机构)</td>\n",
       "      <td>https://www.liepin.com/job/1927756861.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9107555/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>11-30k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>小马快跑日托校长</td>\n",
       "      <td>广州-海珠区</td>\n",
       "      <td>广州喜阳文化发展有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756283.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9733396/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>频道运维岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756245.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>播音主持岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756189.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>后期制作岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756135.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>摄像记者岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927755771.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>11-18k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>高级技校专员/主管</td>\n",
       "      <td>上海-闵行区</td>\n",
       "      <td>西屋无界运动器材(上海)有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927755655.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9752095/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>10-15k·14薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>专职助理</td>\n",
       "      <td></td>\n",
       "      <td>京津冀(固安)城市建设房地产开发有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927755625.shtml</td>\n",
       "      <td>https://www.liepin.com/company/12169565/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>40-70k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>Key Account Sales Lead</td>\n",
       "      <td></td>\n",
       "      <td>呀谧网络科技(上海)有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927755447.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8629524/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>35-60k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>Tenant Operations Manage</td>\n",
       "      <td>上海</td>\n",
       "      <td>呀谧网络科技(上海)有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927755349.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8629524/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>Organization Development</td>\n",
       "      <td>上海</td>\n",
       "      <td>呀谧网络科技(上海)有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927755089.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8629524/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>40-60k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>Training Lead</td>\n",
       "      <td>上海</td>\n",
       "      <td>呀谧网络科技(上海)有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927755043.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8629524/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>唯品会运营主管/经理</td>\n",
       "      <td>杭州-余杭区</td>\n",
       "      <td>杭州麦克斯美贸易有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927754567.shtml</td>\n",
       "      <td>https://www.liepin.com/company/12203823/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15-25k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>董事长助理</td>\n",
       "      <td>广州</td>\n",
       "      <td>泉后集团</td>\n",
       "      <td>https://www.liepin.com/job/1927743139.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10269965/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>学历不限</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>5-12k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>光电顾问</td>\n",
       "      <td>南京-江宁区</td>\n",
       "      <td>江苏灵美东方医院管理有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927739435.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10030447/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>6-8k·13薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>培训经理</td>\n",
       "      <td>南京</td>\n",
       "      <td>南京听雪电子商务有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927734441.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9626311/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>律师</td>\n",
       "      <td>大连-金州区</td>\n",
       "      <td>天瑞集团</td>\n",
       "      <td>https://www.liepin.com/job/1927721247.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8946384/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>12-20k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>成本主管</td>\n",
       "      <td></td>\n",
       "      <td>浙江天喜厨电股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927705159.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9363874/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>10年以上</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>财务总监/CFO</td>\n",
       "      <td>青岛-中韩</td>\n",
       "      <td>青岛博厚医疗管理股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927692867.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9577989/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>5-7k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>化验室检测分析员</td>\n",
       "      <td>湖州-安吉县</td>\n",
       "      <td>浙江天草生物科技股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927688705.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9238325/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>10-15k·13薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>招商主管</td>\n",
       "      <td>杭州-城东</td>\n",
       "      <td>上海德必文化创意产业发展(集团)股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927684179.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8488821/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>8-10k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>房地产营销策划岗</td>\n",
       "      <td>温州-蒲州</td>\n",
       "      <td>温州亿联科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927670589.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10108117/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>8-12k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>项目经理</td>\n",
       "      <td>广州-番禺区</td>\n",
       "      <td>广州沐菁霖广告策划有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927666159.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9473768/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>7-9k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>总经理助理</td>\n",
       "      <td>宁波-海曙区</td>\n",
       "      <td>宁波力达得为高分子科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927654197.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10191859/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>软件工程师</td>\n",
       "      <td>北京</td>\n",
       "      <td>信达地产</td>\n",
       "      <td>https://www.liepin.com/job/1927651467.shtml</td>\n",
       "      <td>https://www.liepin.com/company/402083/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>7-9k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>总账会计</td>\n",
       "      <td>广州-番禺区</td>\n",
       "      <td>至信药业</td>\n",
       "      <td>https://www.liepin.com/job/1927641903.shtml</td>\n",
       "      <td>https://www.liepin.com/company/6511986/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15-20k·15薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>客关经理</td>\n",
       "      <td>南宁</td>\n",
       "      <td>广东奥园商业地产集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927633299.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8608772/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>10-15k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>电商经理</td>\n",
       "      <td>苏州-昆山</td>\n",
       "      <td>腾飞科技股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927623271.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9479204/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>25-35k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>法务副总监/高级经理</td>\n",
       "      <td>常州</td>\n",
       "      <td>常州锦艺置业有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927614447.shtml</td>\n",
       "      <td>https://www.liepin.com/company/12193735/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>4-6k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>会计</td>\n",
       "      <td>青岛-城阳区</td>\n",
       "      <td>青岛裕丰汉唐木业有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927605377.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9825849/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>5-6k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>技术资料员</td>\n",
       "      <td>温州</td>\n",
       "      <td>浙江亚光科技股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927590133.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8070606/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>中专/中技及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>4-7k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>仓库管理员</td>\n",
       "      <td>深圳-新安</td>\n",
       "      <td>Donica</td>\n",
       "      <td>https://www.liepin.com/job/1927573497.shtml</td>\n",
       "      <td>https://www.liepin.com/company/4792377/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>10-18k·13薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>政府项目销售高级经理</td>\n",
       "      <td>郑州</td>\n",
       "      <td>郑州阿帕斯科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927563735.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10058145/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>10-15k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>室内设计师</td>\n",
       "      <td>深圳-龙华区</td>\n",
       "      <td>深圳市阿普合创室内设计顾问有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927469763.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9662591/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>20-25k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>供应链经理</td>\n",
       "      <td>深圳</td>\n",
       "      <td>Donica</td>\n",
       "      <td>https://www.liepin.com/job/1927468887.shtml</td>\n",
       "      <td>https://www.liepin.com/company/4792377/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>15-25k·13薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>市场商务经理</td>\n",
       "      <td>深圳</td>\n",
       "      <td>深圳市博通智能技术有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927439997.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8255169/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15-30k·13薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>品牌主管（经理）</td>\n",
       "      <td>上海-浦东新区</td>\n",
       "      <td>辉文生物技术</td>\n",
       "      <td>https://www.liepin.com/job/1927422085.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8486829/</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         edu     经验          薪水           时间                        职称  \\\n",
       "0      本科及以上   1-3年  15-25k·12薪  2020年04月25日               机器人ros开发工程师   \n",
       "1       统招本科   3-5年  10-25k·12薪  2020年04月25日                 电机控制算法工程师   \n",
       "2       统招本科   3-5年  10-15k·13薪  2020年04月25日                    生鲜运营经理   \n",
       "3      大专及以上  5-10年  10-30k·12薪  2020年04月25日                 储备项目营销负责人   \n",
       "4      本科及以上   1-3年  11-30k·12薪  2020年04月25日                  小马快跑日托校长   \n",
       "5       统招本科   1-3年          面议  2020年04月25日                     频道运维岗   \n",
       "6       统招本科   1-3年          面议  2020年04月25日                     播音主持岗   \n",
       "7       统招本科   1-3年          面议  2020年04月25日                     后期制作岗   \n",
       "8       统招本科   1-3年          面议  2020年04月25日                     摄像记者岗   \n",
       "9      本科及以上   3-5年  11-18k·12薪  2020年04月25日                 高级技校专员/主管   \n",
       "10     本科及以上   经验不限  10-15k·14薪  2020年04月25日                      专职助理   \n",
       "11      统招本科  5-10年  40-70k·12薪  2020年04月25日    Key Account Sales Lead   \n",
       "12      统招本科  5-10年  35-60k·12薪  2020年04月25日  Tenant Operations Manage   \n",
       "13      统招本科   3-5年  20-30k·12薪  2020年04月25日  Organization Development   \n",
       "14      统招本科  5-10年  40-60k·12薪  2020年04月25日             Training Lead   \n",
       "15     大专及以上   3-5年          面议  2020年04月25日                唯品会运营主管/经理   \n",
       "16      统招本科   3-5年  15-25k·12薪  2020年04月25日                     董事长助理   \n",
       "17      学历不限   1-3年   5-12k·12薪  2020年04月25日                      光电顾问   \n",
       "18     本科及以上   3-5年    6-8k·13薪  2020年04月25日                      培训经理   \n",
       "19     本科及以上  5-10年          面议  2020年04月25日                        律师   \n",
       "20     本科及以上   3-5年  12-20k·12薪  2020年04月25日                      成本主管   \n",
       "21      统招本科  10年以上          面议  2020年04月25日                  财务总监/CFO   \n",
       "22     大专及以上   1-3年    5-7k·12薪  2020年04月25日                  化验室检测分析员   \n",
       "23      统招本科   1-3年  10-15k·13薪  2020年04月25日                      招商主管   \n",
       "24      统招本科   3-5年   8-10k·12薪  2020年04月25日                  房地产营销策划岗   \n",
       "25     大专及以上   3-5年   8-12k·12薪  2020年04月25日                      项目经理   \n",
       "26     大专及以上   1-3年    7-9k·12薪  2020年04月25日                     总经理助理   \n",
       "27      统招本科   经验不限          面议  2020年04月25日                     软件工程师   \n",
       "28     大专及以上   3-5年    7-9k·12薪  2020年04月25日                      总账会计   \n",
       "29     本科及以上   3-5年  15-20k·15薪  2020年04月25日                      客关经理   \n",
       "30     大专及以上   3-5年  10-15k·12薪  2020年04月25日                      电商经理   \n",
       "31      统招本科  5-10年  25-35k·12薪  2020年04月25日                法务副总监/高级经理   \n",
       "32      统招本科   经验不限    4-6k·12薪  2020年04月25日                        会计   \n",
       "33      统招本科   经验不限    5-6k·12薪  2020年04月25日                     技术资料员   \n",
       "34  中专/中技及以上   3-5年    4-7k·12薪  2020年04月25日                     仓库管理员   \n",
       "35      统招本科  5-10年  10-18k·13薪  2020年04月25日                政府项目销售高级经理   \n",
       "36     大专及以上  5-10年  10-15k·12薪  2020年04月25日                     室内设计师   \n",
       "37     本科及以上  5-10年  20-25k·12薪  2020年04月25日                     供应链经理   \n",
       "38      统招本科  5-10年  15-25k·13薪  2020年04月25日                    市场商务经理   \n",
       "39     大专及以上   3-5年  15-30k·13薪  2020年04月25日                  品牌主管（经理）   \n",
       "\n",
       "       公司地点                    公司名称  \\\n",
       "0        深圳            深圳博鹏智能科技有限公司   \n",
       "1    珠海-香洲区                     英搏尔   \n",
       "2                    正大食品企业(青岛)有限公司   \n",
       "3        唐山      碧桂园营销中心-天津区域(分支机构)   \n",
       "4    广州-海珠区            广州喜阳文化发展有限公司   \n",
       "5    济南-高新区            中国重型汽车集团有限公司   \n",
       "6    济南-高新区            中国重型汽车集团有限公司   \n",
       "7    济南-高新区            中国重型汽车集团有限公司   \n",
       "8    济南-高新区            中国重型汽车集团有限公司   \n",
       "9    上海-闵行区        西屋无界运动器材(上海)有限公司   \n",
       "10             京津冀(固安)城市建设房地产开发有限公司   \n",
       "11                   呀谧网络科技(上海)有限公司   \n",
       "12       上海          呀谧网络科技(上海)有限公司   \n",
       "13       上海          呀谧网络科技(上海)有限公司   \n",
       "14       上海          呀谧网络科技(上海)有限公司   \n",
       "15   杭州-余杭区            杭州麦克斯美贸易有限公司   \n",
       "16       广州                    泉后集团   \n",
       "17   南京-江宁区          江苏灵美东方医院管理有限公司   \n",
       "18       南京            南京听雪电子商务有限公司   \n",
       "19   大连-金州区                    天瑞集团   \n",
       "20                     浙江天喜厨电股份有限公司   \n",
       "21    青岛-中韩          青岛博厚医疗管理股份有限公司   \n",
       "22   湖州-安吉县          浙江天草生物科技股份有限公司   \n",
       "23    杭州-城东  上海德必文化创意产业发展(集团)股份有限公司   \n",
       "24    温州-蒲州              温州亿联科技有限公司   \n",
       "25   广州-番禺区           广州沐菁霖广告策划有限公司   \n",
       "26   宁波-海曙区         宁波力达得为高分子科技有限公司   \n",
       "27       北京                    信达地产   \n",
       "28   广州-番禺区                    至信药业   \n",
       "29       南宁          广东奥园商业地产集团有限公司   \n",
       "30    苏州-昆山              腾飞科技股份有限公司   \n",
       "31       常州              常州锦艺置业有限公司   \n",
       "32   青岛-城阳区            青岛裕丰汉唐木业有限公司   \n",
       "33       温州            浙江亚光科技股份有限公司   \n",
       "34    深圳-新安                  Donica   \n",
       "35       郑州             郑州阿帕斯科技有限公司   \n",
       "36   深圳-龙华区       深圳市阿普合创室内设计顾问有限公司   \n",
       "37       深圳                  Donica   \n",
       "38       深圳           深圳市博通智能技术有限公司   \n",
       "39  上海-浦东新区                  辉文生物技术   \n",
       "\n",
       "                                             链结  \\\n",
       "0   https://www.liepin.com/job/1927758683.shtml   \n",
       "1   https://www.liepin.com/job/1927758509.shtml   \n",
       "2   https://www.liepin.com/job/1927757141.shtml   \n",
       "3   https://www.liepin.com/job/1927756861.shtml   \n",
       "4   https://www.liepin.com/job/1927756283.shtml   \n",
       "5   https://www.liepin.com/job/1927756245.shtml   \n",
       "6   https://www.liepin.com/job/1927756189.shtml   \n",
       "7   https://www.liepin.com/job/1927756135.shtml   \n",
       "8   https://www.liepin.com/job/1927755771.shtml   \n",
       "9   https://www.liepin.com/job/1927755655.shtml   \n",
       "10  https://www.liepin.com/job/1927755625.shtml   \n",
       "11  https://www.liepin.com/job/1927755447.shtml   \n",
       "12  https://www.liepin.com/job/1927755349.shtml   \n",
       "13  https://www.liepin.com/job/1927755089.shtml   \n",
       "14  https://www.liepin.com/job/1927755043.shtml   \n",
       "15  https://www.liepin.com/job/1927754567.shtml   \n",
       "16  https://www.liepin.com/job/1927743139.shtml   \n",
       "17  https://www.liepin.com/job/1927739435.shtml   \n",
       "18  https://www.liepin.com/job/1927734441.shtml   \n",
       "19  https://www.liepin.com/job/1927721247.shtml   \n",
       "20  https://www.liepin.com/job/1927705159.shtml   \n",
       "21  https://www.liepin.com/job/1927692867.shtml   \n",
       "22  https://www.liepin.com/job/1927688705.shtml   \n",
       "23  https://www.liepin.com/job/1927684179.shtml   \n",
       "24  https://www.liepin.com/job/1927670589.shtml   \n",
       "25  https://www.liepin.com/job/1927666159.shtml   \n",
       "26  https://www.liepin.com/job/1927654197.shtml   \n",
       "27  https://www.liepin.com/job/1927651467.shtml   \n",
       "28  https://www.liepin.com/job/1927641903.shtml   \n",
       "29  https://www.liepin.com/job/1927633299.shtml   \n",
       "30  https://www.liepin.com/job/1927623271.shtml   \n",
       "31  https://www.liepin.com/job/1927614447.shtml   \n",
       "32  https://www.liepin.com/job/1927605377.shtml   \n",
       "33  https://www.liepin.com/job/1927590133.shtml   \n",
       "34  https://www.liepin.com/job/1927573497.shtml   \n",
       "35  https://www.liepin.com/job/1927563735.shtml   \n",
       "36  https://www.liepin.com/job/1927469763.shtml   \n",
       "37  https://www.liepin.com/job/1927468887.shtml   \n",
       "38  https://www.liepin.com/job/1927439997.shtml   \n",
       "39  https://www.liepin.com/job/1927422085.shtml   \n",
       "\n",
       "                                       公司URL  \n",
       "0   https://www.liepin.com/company/10005407/  \n",
       "1    https://www.liepin.com/company/9557666/  \n",
       "2    https://www.liepin.com/company/8852429/  \n",
       "3    https://www.liepin.com/company/9107555/  \n",
       "4    https://www.liepin.com/company/9733396/  \n",
       "5    https://www.liepin.com/company/9739005/  \n",
       "6    https://www.liepin.com/company/9739005/  \n",
       "7    https://www.liepin.com/company/9739005/  \n",
       "8    https://www.liepin.com/company/9739005/  \n",
       "9    https://www.liepin.com/company/9752095/  \n",
       "10  https://www.liepin.com/company/12169565/  \n",
       "11   https://www.liepin.com/company/8629524/  \n",
       "12   https://www.liepin.com/company/8629524/  \n",
       "13   https://www.liepin.com/company/8629524/  \n",
       "14   https://www.liepin.com/company/8629524/  \n",
       "15  https://www.liepin.com/company/12203823/  \n",
       "16  https://www.liepin.com/company/10269965/  \n",
       "17  https://www.liepin.com/company/10030447/  \n",
       "18   https://www.liepin.com/company/9626311/  \n",
       "19   https://www.liepin.com/company/8946384/  \n",
       "20   https://www.liepin.com/company/9363874/  \n",
       "21   https://www.liepin.com/company/9577989/  \n",
       "22   https://www.liepin.com/company/9238325/  \n",
       "23   https://www.liepin.com/company/8488821/  \n",
       "24  https://www.liepin.com/company/10108117/  \n",
       "25   https://www.liepin.com/company/9473768/  \n",
       "26  https://www.liepin.com/company/10191859/  \n",
       "27    https://www.liepin.com/company/402083/  \n",
       "28   https://www.liepin.com/company/6511986/  \n",
       "29   https://www.liepin.com/company/8608772/  \n",
       "30   https://www.liepin.com/company/9479204/  \n",
       "31  https://www.liepin.com/company/12193735/  \n",
       "32   https://www.liepin.com/company/9825849/  \n",
       "33   https://www.liepin.com/company/8070606/  \n",
       "34   https://www.liepin.com/company/4792377/  \n",
       "35  https://www.liepin.com/company/10058145/  \n",
       "36   https://www.liepin.com/company/9662591/  \n",
       "37   https://www.liepin.com/company/4792377/  \n",
       "38   https://www.liepin.com/company/8255169/  \n",
       "39   https://www.liepin.com/company/8486829/  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# A-1   单一页面\n",
    "url = \"https://www.liepin.com/zhaopin/?keyword=PRD\"\n",
    "session = HTMLSession()\n",
    "r = session.get( url )\n",
    "\n",
    "# 先取特定元素, 精准打击其子后辈\n",
    "主要元素 = r.html.xpath( \\\n",
    "    '//ul[@class=\"sojob-list\"]/li')\n",
    "\n",
    "# 预期是一个元素的列表？\n",
    "#print (主要元素[0].xpath('//div[contains(@class,\"sojob-item-main\")]'))\n",
    "#print (主要元素[0].xpath('//div[contains(@class,\"job-info\")]/h3/a'))\n",
    "#print (主要元素[3].xpath('//div[contains(@class,\"job-info\")]/p/a'))\n",
    "#print (主要元素[3].xpath('//div[contains(@class,\"job-info\")]/p/span[@class=\"text-warning\"]'))\n",
    "#print (主要元素[3].xpath('//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]/following-sibling::span'))\n",
    "#print (主要元素[3].xpath('//div[contains(@class,\"job-info\")]/p/time/@title'))\n",
    "#print (主要元素[0].xpath('//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a'))\n",
    "\n",
    "# 作为xpath字典，键为我要抓的牛肉名称，值为xpath\n",
    "dict_xpaths={ \n",
    "    'text': {\n",
    "        'edu':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]',\n",
    "        '经验':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]/following-sibling::span',\n",
    "        '薪水':    '//div[contains(@class,\"job-info\")]/p/span[@class=\"text-warning\"]', \n",
    "        '时间':    '//div[contains(@class,\"job-info\")]/p/time/@title', \n",
    "        '职称':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "        '公司地点': '//div[contains(@class,\"job-info\")]/p/a',\n",
    "        '公司名称': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a', \n",
    "    },\n",
    "    'text_content': {\n",
    "    },\n",
    "    'href': {\n",
    "        '链结':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "        '公司URL': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a', \n",
    "    }\n",
    "}\n",
    "\n",
    "def get_e_text_content(_xpath_):\n",
    "    # 高级列表推导\n",
    "    暂存结果 = [e.xpath(_xpath_)[0].lxml.text_content() for e in 主要元素]\n",
    "    return(暂存结果)\n",
    "\n",
    "def get_e_text(_xpath_):\n",
    "    # 高级列表推导\n",
    "    暂存结果 = [\"\".join([x.strip() if type(x) is str else x.text.strip() for x in e.xpath(_xpath_)]) for e in 主要元素]\n",
    "    return(暂存结果)\n",
    "\n",
    "def get_e_href(_xpath_):\n",
    "    # 高级列表推导\n",
    "    暂存结果 = [list(e.xpath(_xpath_, first=True).absolute_links)[0] \\\n",
    "               if len(e.xpath(_xpath_, first=True).absolute_links) >= 1  \\\n",
    "               else \"\" for e in 主要元素]\n",
    "    return(暂存结果)\n",
    "\n",
    "# 只对主要元素下进行.xpath取值\n",
    "数据字典 = dict()\n",
    "\n",
    "数据字典 = {k:get_e_text_content(v) for k,v in dict_xpaths['text_content'].items()}\n",
    "数据字典.update({k:get_e_text(v) for k,v in dict_xpaths['text'].items()})\n",
    "数据字典.update({k:get_e_href(v) for k,v in dict_xpaths['href'].items()})\n",
    "\n",
    "[len(v) for k,v in 数据字典.items()]\n",
    "\n",
    "数据 = pd.DataFrame(数据字典)\n",
    "#数据.to_excel(\"20春_Web数据挖掘_week03_liepin.xlsx\", sheet_name=\"搜查结果\")\n",
    "数据 "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 公司"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<Element 'div' class=('search-conditions',) data-selector='search-conditions'>]\n",
      "<Element 'div' class=('search-conditions',) data-selector='search-conditions'>\n",
      "[<Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>]\n",
      "公司：\n",
      "行业：\n",
      "城市：\n",
      "薪资：\n",
      "更多：\n",
      "<Element 'dd' class=('comp-list',)>\n",
      "<Element 'dd' class=('short-dd', 'select-industry') data-param='industries'>\n",
      "<Element 'dd' data-param='city'>\n",
      "<Element 'dd' data-param='salary'>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-time')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-jobkind')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-compscale')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-compkind')>\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'中国500强': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=155&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '2018互联网300强': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=182&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '制造业500强': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=186&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " 'AI创新成长50强 ': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=189&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '独角兽': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=130&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '上市公司': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=156&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e'}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# A-2 扩张 公司?  \n",
    "\n",
    "# 先取特定元素, 精准打击其子后辈\n",
    "主要元素 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')\n",
    "# 预期是一个元素的列表？\n",
    "print (主要元素)\n",
    "print (主要元素[0])\n",
    "print (主要元素[0].xpath('//dt[@class=\"search-title\"]'))\n",
    "\n",
    "list_search_title = 主要元素[0].xpath('//dt[@class=\"search-title\"]')\n",
    "for x in list_search_title:\n",
    "    print (x.text)\n",
    "    \n",
    "list_search_dd = 主要元素[0].xpath('//dt[@class=\"search-title\"]/following-sibling::dd')\n",
    "for x in list_search_dd:\n",
    "    print (x)  \n",
    "    \n",
    "\n",
    "公司数据选择器链结 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')[0] \\\n",
    "                    .xpath('//dt[@class=\"search-title\"]/following-sibling::dd')[0] \\\n",
    "                    .xpath('//div[contains(@class,\"hot-comp-tags\")]/a/@href')\n",
    "               \n",
    "公司数据选择器链结\n",
    "\n",
    "# 但我们需要知道这些选择器链结, 对映到什麽数据\n",
    "公司数据选择器链结 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')[0] \\\n",
    "                    .xpath('//dt[@class=\"search-title\"]/following-sibling::dd')[0] \\\n",
    "                    .xpath('//div[contains(@class,\"hot-comp-tags\")]/a')\n",
    "公司数据选择器链结\n",
    "\n",
    "#[ x.xpath(\"a/@href\")[0] for x in 公司数据选择器链结]\n",
    "#[ x.xpath(\"a/text()\")[0] for x in 公司数据选择器链结]\n",
    "公司数据选择器链结 = { x.xpath(\"a/text()\")[0]:x.xpath(\"a/@href\")[0] for x in 公司数据选择器链结}\n",
    "公司数据选择器链结"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=155&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=182&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=186&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=189&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=130&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=PRD&compTag=156&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment='')]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from urllib.parse import urlparse, parse_qs\n",
    "[ urlparse(x) for x in 公司数据选择器链结.values()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 6 entries, 0 to 5\n",
      "Data columns (total 6 columns):\n",
      " #   Column    Non-Null Count  Dtype \n",
      "---  ------    --------------  ----- \n",
      " 0   scheme    6 non-null      object\n",
      " 1   netloc    6 non-null      object\n",
      " 2   path      6 non-null      object\n",
      " 3   params    6 non-null      object\n",
      " 4   query     6 non-null      object\n",
      " 5   fragment  6 non-null      object\n",
      "dtypes: object(6)\n",
      "memory usage: 416.0+ bytes\n",
      "scheme      1\n",
      "netloc      1\n",
      "path        1\n",
      "params      1\n",
      "query       6\n",
      "fragment    1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>scheme</th>\n",
       "      <th>netloc</th>\n",
       "      <th>path</th>\n",
       "      <th>params</th>\n",
       "      <th>query</th>\n",
       "      <th>fragment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=c8f406abef58e2f1&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  scheme netloc       path params  \\\n",
       "0                /zhaopin/          \n",
       "\n",
       "                                               query fragment  \n",
       "0  init=-1&headckid=c8f406abef58e2f1&flushckid=1&...           "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "df = pd.DataFrame([ urlparse(x) for x in 公司数据选择器链结.values()])\n",
    "df.info()\n",
    "print(df.nunique())\n",
    "df.head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init             1\n",
      "headckid         1\n",
      "flushckid        1\n",
      "fromSearchBtn    1\n",
      "keyword          1\n",
      "compTag          6\n",
      "ckid             1\n",
      "siTag            1\n",
      "d_sfrom          1\n",
      "d_ckId           1\n",
      "d_curPage        1\n",
      "d_pageSize       1\n",
      "d_headId         1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>keyword</th>\n",
       "      <th>compTag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>PRD</td>\n",
       "      <td>155</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>PRD</td>\n",
       "      <td>182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>PRD</td>\n",
       "      <td>186</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>PRD</td>\n",
       "      <td>189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>PRD</td>\n",
       "      <td>130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>PRD</td>\n",
       "      <td>156</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  keyword compTag\n",
       "0     PRD     155\n",
       "1     PRD     182\n",
       "2     PRD     186\n",
       "3     PRD     189\n",
       "4     PRD     130\n",
       "5     PRD     156"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_qs = pd.DataFrame([{k:v[0] for k,v in parse_qs(x).items()} for x in df['query'] ])\n",
    "print (df_qs.nunique())\n",
    "df_qs.head()\n",
    "df_qs[['keyword','compTag']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[{'init': '-1', 'headckid': 'c8f406abef58e2f1', 'flushckid': '1', 'fromSearchBtn': '2', 'keyword': 'PRD', 'compTag': '155', 'ckid': 'c8f406abef58e2f1', 'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw', 'd_sfrom': 'search_unknown', 'd_ckId': '02df37f1add833b3345742bf157ed71e', 'd_curPage': '0', 'd_pageSize': '40', 'd_headId': '02df37f1add833b3345742bf157ed71e'}, {'init': '-1', 'headckid': 'c8f406abef58e2f1', 'flushckid': '1', 'fromSearchBtn': '2', 'keyword': 'PRD', 'compTag': '182', 'ckid': 'c8f406abef58e2f1', 'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw', 'd_sfrom': 'search_unknown', 'd_ckId': '02df37f1add833b3345742bf157ed71e', 'd_curPage': '0', 'd_pageSize': '40', 'd_headId': '02df37f1add833b3345742bf157ed71e'}, {'init': '-1', 'headckid': 'c8f406abef58e2f1', 'flushckid': '1', 'fromSearchBtn': '2', 'keyword': 'PRD', 'compTag': '186', 'ckid': 'c8f406abef58e2f1', 'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw', 'd_sfrom': 'search_unknown', 'd_ckId': '02df37f1add833b3345742bf157ed71e', 'd_curPage': '0', 'd_pageSize': '40', 'd_headId': '02df37f1add833b3345742bf157ed71e'}, {'init': '-1', 'headckid': 'c8f406abef58e2f1', 'flushckid': '1', 'fromSearchBtn': '2', 'keyword': 'PRD', 'compTag': '189', 'ckid': 'c8f406abef58e2f1', 'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw', 'd_sfrom': 'search_unknown', 'd_ckId': '02df37f1add833b3345742bf157ed71e', 'd_curPage': '0', 'd_pageSize': '40', 'd_headId': '02df37f1add833b3345742bf157ed71e'}, {'init': '-1', 'headckid': 'c8f406abef58e2f1', 'flushckid': '1', 'fromSearchBtn': '2', 'keyword': 'PRD', 'compTag': '130', 'ckid': 'c8f406abef58e2f1', 'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw', 'd_sfrom': 'search_unknown', 'd_ckId': '02df37f1add833b3345742bf157ed71e', 'd_curPage': '0', 'd_pageSize': '40', 'd_headId': '02df37f1add833b3345742bf157ed71e'}, {'init': '-1', 'headckid': 'c8f406abef58e2f1', 'flushckid': '1', 'fromSearchBtn': '2', 'keyword': 'PRD', 'compTag': '156', 'ckid': 'c8f406abef58e2f1', 'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw', 'd_sfrom': 'search_unknown', 'd_ckId': '02df37f1add833b3345742bf157ed71e', 'd_curPage': '0', 'd_pageSize': '40', 'd_headId': '02df37f1add833b3345742bf157ed71e'}] {'init': '-1', 'headckid': 'c8f406abef58e2f1', 'flushckid': '1', 'fromSearchBtn': '2', 'keyword': 'PRD', 'compTag': '156', 'ckid': 'c8f406abef58e2f1', 'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw', 'd_sfrom': 'search_unknown', 'd_ckId': '02df37f1add833b3345742bf157ed71e', 'd_curPage': '0', 'd_pageSize': '40', 'd_headId': '02df37f1add833b3345742bf157ed71e'}\n"
     ]
    }
   ],
   "source": [
    "列表暂存 = [] \n",
    "for x in df['query']: \n",
    "    列表暂存.append({k:v[0] for k,v in parse_qs(x).items()} )\n",
    "字典暂存 = dict()\n",
    "for k,v in parse_qs(x).items():           \n",
    "    字典暂存.update({k:v[0]})\n",
    "print (列表暂存, 字典暂存) \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'keyword': 'PRD',\n",
       "  'compTag': '155',\n",
       "  'ckid': 'c8f406abef58e2f1',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'keyword': 'PRD',\n",
       "  'compTag': '182',\n",
       "  'ckid': 'c8f406abef58e2f1',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'keyword': 'PRD',\n",
       "  'compTag': '186',\n",
       "  'ckid': 'c8f406abef58e2f1',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'keyword': 'PRD',\n",
       "  'compTag': '189',\n",
       "  'ckid': 'c8f406abef58e2f1',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'keyword': 'PRD',\n",
       "  'compTag': '130',\n",
       "  'ckid': 'c8f406abef58e2f1',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'keyword': 'PRD',\n",
       "  'compTag': '156',\n",
       "  'ckid': 'c8f406abef58e2f1',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'}]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 列表暂存\n",
    "列表暫存 = [] # list()\n",
    "for q in df['query']: \n",
    "    字典暫存 = dict()\n",
    "    for k,v in parse_qs(q).items(): # for 鍵,值 in 字典.items():\n",
    "        字典暫存.update({k:v[0]})\n",
    "    列表暫存.append(字典暫存)\n",
    "列表暫存"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['PRD'], 'compTag': ['155'], 'ckid': ['c8f406abef58e2f1'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}\n",
      "{'中国500强': '155', '2018互联网300强': '182', '制造业500强': '186', 'AI创新成长50强 ': '189', '独角兽': '130', '上市公司': '156'}\n"
     ]
    }
   ],
   "source": [
    "# 建构参数模板及字典_compTag\n",
    "def parse_url_qs_for_compTag (url):\n",
    "    six_parts = urlparse(url) \n",
    "    out = parse_qs(six_parts.query)\n",
    "    return (out)\n",
    "\n",
    "参数模板 = parse_url_qs_for_compTag(list(公司数据选择器链结.values())[0])\n",
    "print(参数模板)\n",
    "[ parse_url_qs_for_compTag(x)['compTag'][0] for x in 公司数据选择器链结.values()]\n",
    "\n",
    "字典_compTag = { k:parse_url_qs_for_compTag(v)['compTag'][0] for k,v in 公司数据选择器链结.items()}\n",
    "print (字典_compTag)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'中国500强': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['用户体验'], 'compTag': ['155'], 'ckid': ['c8f406abef58e2f1'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '2018互联网300强': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['用户体验'], 'compTag': ['182'], 'ckid': ['c8f406abef58e2f1'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '制造业500强': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['用户体验'], 'compTag': ['186'], 'ckid': ['c8f406abef58e2f1'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, 'AI创新成长50强 ': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['用户体验'], 'compTag': ['189'], 'ckid': ['c8f406abef58e2f1'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '独角兽': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['用户体验'], 'compTag': ['130'], 'ckid': ['c8f406abef58e2f1'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '上市公司': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['用户体验'], 'compTag': ['156'], 'ckid': ['c8f406abef58e2f1'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}}\n"
     ]
    }
   ],
   "source": [
    "def 参数模板建成(compTag,keyword):\n",
    "    参数 = 参数模板.copy()\n",
    "    参数['compTag'] = compTag\n",
    "    参数['keyword'] = keyword\n",
    "    return (参数)\n",
    "参数_compTag_用户体验 = { k:参数模板建成(compTag = [v],keyword = ['用户体验']) for k,v in 字典_compTag.items()}\n",
    "print(参数_compTag_用户体验)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'https://www.liepin.com/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&compTag=155&ckid=c8f406abef58e2f1&siTag=1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 多个页面的测试\n",
    "url = \"https://www.liepin.com/zhaopin/\"\n",
    "session = HTMLSession()\n",
    "payload = 参数_compTag_用户体验['中国500强']\n",
    "r = session.get( url, params = payload)\n",
    "r.url"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 简化   单一页面爬+解析、创建request_liepin\n",
    "session = HTMLSession()\n",
    "\n",
    "def requests_liepin( url, params):       #创建request_liepin\n",
    "    r = session.get( url , params = payload)\n",
    "\n",
    "    # 先取特定元素, 精准打击其子后辈\n",
    "    主要元素 = r.html.xpath( '//ul[@class=\"sojob-list\"]/li')\n",
    "\n",
    "    # 作为xpath字典，键为我要抓的牛肉名称，值为xpath\n",
    "    dict_xpaths={ \n",
    "        'text': {\n",
    "            'edu':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]',\n",
    "            '经验':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]/following-sibling::span',\n",
    "            '薪水':    '//div[contains(@class,\"job-info\")]/p/span[@class=\"text-warning\"]', \n",
    "            '时间':    '//div[contains(@class,\"job-info\")]/p/time/@title', \n",
    "            '职称':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "            '公司地点': '//div[contains(@class,\"job-info\")]/p/a',\n",
    "            '公司名称': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a', \n",
    "        },\n",
    "        'text_content': {\n",
    "        },\n",
    "        'href': {\n",
    "            '链结':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "            '公司URL': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a', \n",
    "        }\n",
    "    }\n",
    "\n",
    "    def get_e_text_content(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [e.xpath(_xpath_)[0].lxml.text_content() for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    def get_e_text(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [\"\".join([x.strip() if type(x) is str else x.text.strip() for x in e.xpath(_xpath_)]) for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    def get_e_href(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [list(e.xpath(_xpath_, first=True).absolute_links)[0] \\\n",
    "                   if len(e.xpath(_xpath_, first=True).absolute_links) >= 1  \\\n",
    "                   else \"\" for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    # 只对主要元素下进行.xpath取值\n",
    "    数据字典 = dict()\n",
    "\n",
    "    数据字典 = {k:get_e_text_content(v) for k,v in dict_xpaths['text_content'].items()}\n",
    "    数据字典.update({k:get_e_text(v) for k,v in dict_xpaths['text'].items()})\n",
    "    数据字典.update({k:get_e_href(v) for k,v in dict_xpaths['href'].items()})\n",
    "\n",
    "    数据 = pd.DataFrame(数据字典)\n",
    "    #数据.to_excel(\"20春_Web数据挖掘_week03_liepin.xlsx\", sheet_name=\"搜查结果\")\n",
    "    return (数据)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>edu</th>\n",
       "      <th>经验</th>\n",
       "      <th>薪水</th>\n",
       "      <th>时间</th>\n",
       "      <th>职称</th>\n",
       "      <th>公司地点</th>\n",
       "      <th>公司名称</th>\n",
       "      <th>链结</th>\n",
       "      <th>公司URL</th>\n",
       "      <th>热门公司类型</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>频道运维岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756245.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>播音主持岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756189.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>后期制作岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756135.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>摄像记者岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927755771.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>律师</td>\n",
       "      <td>大连-金州区</td>\n",
       "      <td>天瑞集团</td>\n",
       "      <td>https://www.liepin.com/job/1927721247.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8946384/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月15日</td>\n",
       "      <td>Android工程师(J11100)</td>\n",
       "      <td>杭州-下城区</td>\n",
       "      <td>微贷</td>\n",
       "      <td>https://www.liepin.com/job/1927469381.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8597281/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>16-41k·12薪</td>\n",
       "      <td>2020年04月14日</td>\n",
       "      <td>私人财富管家/私人银行理财经理</td>\n",
       "      <td>太原-三桥</td>\n",
       "      <td>山西证券</td>\n",
       "      <td>https://www.liepin.com/job/1923874779.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8538316/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>30-50k·12薪</td>\n",
       "      <td>2020年04月13日</td>\n",
       "      <td>集团总部投资总监</td>\n",
       "      <td>深圳-南山区</td>\n",
       "      <td>禹洲地产股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927409715.shtml</td>\n",
       "      <td>https://www.liepin.com/company/2245242/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15-25k·13薪</td>\n",
       "      <td>2020年04月13日</td>\n",
       "      <td>高级运维开发工程师</td>\n",
       "      <td>杭州</td>\n",
       "      <td>网易集团</td>\n",
       "      <td>https://www.liepin.com/job/1926674043.shtml</td>\n",
       "      <td>https://www.liepin.com/company/5964833/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月10日</td>\n",
       "      <td>集团总部招采总监</td>\n",
       "      <td>深圳-南山区</td>\n",
       "      <td>禹洲地产股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927352801.shtml</td>\n",
       "      <td>https://www.liepin.com/company/2245242/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>240 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      edu     经验          薪水           时间                  职称    公司地点  \\\n",
       "0    统招本科   1-3年          面议  2020年04月25日               频道运维岗  济南-高新区   \n",
       "1    统招本科   1-3年          面议  2020年04月25日               播音主持岗  济南-高新区   \n",
       "2    统招本科   1-3年          面议  2020年04月25日               后期制作岗  济南-高新区   \n",
       "3    统招本科   1-3年          面议  2020年04月25日               摄像记者岗  济南-高新区   \n",
       "4   本科及以上  5-10年          面议  2020年04月25日                  律师  大连-金州区   \n",
       "..    ...    ...         ...          ...                 ...     ...   \n",
       "35  大专及以上   3-5年          面议  2020年04月15日  Android工程师(J11100)  杭州-下城区   \n",
       "36   统招本科   3-5年  16-41k·12薪  2020年04月14日     私人财富管家/私人银行理财经理   太原-三桥   \n",
       "37   统招本科  5-10年  30-50k·12薪  2020年04月13日            集团总部投资总监  深圳-南山区   \n",
       "38  本科及以上   3-5年  15-25k·13薪  2020年04月13日           高级运维开发工程师      杭州   \n",
       "39   统招本科  5-10年          面议  2020年04月10日            集团总部招采总监  深圳-南山区   \n",
       "\n",
       "            公司名称                                           链结  \\\n",
       "0   中国重型汽车集团有限公司  https://www.liepin.com/job/1927756245.shtml   \n",
       "1   中国重型汽车集团有限公司  https://www.liepin.com/job/1927756189.shtml   \n",
       "2   中国重型汽车集团有限公司  https://www.liepin.com/job/1927756135.shtml   \n",
       "3   中国重型汽车集团有限公司  https://www.liepin.com/job/1927755771.shtml   \n",
       "4           天瑞集团  https://www.liepin.com/job/1927721247.shtml   \n",
       "..           ...                                          ...   \n",
       "35            微贷  https://www.liepin.com/job/1927469381.shtml   \n",
       "36          山西证券  https://www.liepin.com/job/1923874779.shtml   \n",
       "37    禹洲地产股份有限公司  https://www.liepin.com/job/1927409715.shtml   \n",
       "38          网易集团  https://www.liepin.com/job/1926674043.shtml   \n",
       "39    禹洲地产股份有限公司  https://www.liepin.com/job/1927352801.shtml   \n",
       "\n",
       "                                      公司URL  热门公司类型  \n",
       "0   https://www.liepin.com/company/9739005/  中国500强  \n",
       "1   https://www.liepin.com/company/9739005/  中国500强  \n",
       "2   https://www.liepin.com/company/9739005/  中国500强  \n",
       "3   https://www.liepin.com/company/9739005/  中国500强  \n",
       "4   https://www.liepin.com/company/8946384/  中国500强  \n",
       "..                                      ...     ...  \n",
       "35  https://www.liepin.com/company/8597281/    上市公司  \n",
       "36  https://www.liepin.com/company/8538316/    上市公司  \n",
       "37  https://www.liepin.com/company/2245242/    上市公司  \n",
       "38  https://www.liepin.com/company/5964833/    上市公司  \n",
       "39  https://www.liepin.com/company/2245242/    上市公司  \n",
       "\n",
       "[240 rows x 10 columns]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url = \"https://www.liepin.com/zhaopin/\"\n",
    "\n",
    "list_df = list()\n",
    "for k,v in 参数_compTag_用户体验.items():\n",
    "    payload = v\n",
    "    df = requests_liepin( url, params = payload)\n",
    "    df = df.assign (热门公司类型 = k)    \n",
    "    list_df.append(df)\n",
    "\n",
    "df_all = pd.concat(list_df)\n",
    "df_all"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# 输出\n",
    "df_all.to_excel(\"20春_Web数据挖掘_week03_liepin_各热门公司类型.xlsx\", sheet_name=\"搜查结果\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 行业"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<Element 'div' class=('search-conditions',) data-selector='search-conditions'>]\n",
      "<Element 'div' class=('search-conditions',) data-selector='search-conditions'>\n",
      "[<Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>]\n",
      "公司：\n",
      "行业：\n",
      "城市：\n",
      "薪资：\n",
      "更多：\n",
      "<Element 'dd' class=('comp-list',)>\n",
      "<Element 'dd' class=('short-dd', 'select-industry') data-param='industries'>\n",
      "<Element 'dd' data-param='city'>\n",
      "<Element 'dd' data-param='salary'>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-time')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-jobkind')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-compscale')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-compkind')>\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'互联网/电商': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_01&industries=040&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '游戏产业': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_01&industries=420&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '计算机软件': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_01&industries=010&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " 'IT服务': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_01&industries=030&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '电子/芯片/半导体': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_02&industries=050&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '通信业': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_02&industries=060&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '计算机/网络设备': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_02&industries=020&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '房地产/建筑': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_03&industries=080&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '规划/设计/装潢': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_03&industries=100&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '房地产服务': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_03&industries=090&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '银行': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=130&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '保险': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=140&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '基金/证券/投资': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=150&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '会计/审计': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=430&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '信托/担保/拍卖': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=500&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '快消品': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=190&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '批发零售': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=240&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '服装纺织': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=200&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '家具/家电': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=210&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '办公设备': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=220&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '奢侈品/收藏品': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=460&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '珠宝/玩具/工艺品': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=470&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '汽车/摩托车': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=350&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '机械/机电/重工': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=360&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '印刷/包装/造纸': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=180&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '原材料加工': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=370&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '仪器/电气/自动化': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=340&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '制药/生物工程': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_10&industries=270&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '医疗/保健/美容': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_10&industries=280&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '医疗器械': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_10&industries=290&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '能源/水利': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=330&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '石油/化工': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=310&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '采掘/冶炼/矿产': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=320&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '环保': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=300&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '新能源': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=490&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '专业服务': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=120&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '中介服务': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=110&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '外包服务': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=440&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '检测/认证': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=450&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '餐饮/酒旅/服务': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=230&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '文体娱乐': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=260&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '租赁服务': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=510&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '广告/市场/会展': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_08&industries=070&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '影视文化': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_08&industries=170&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '教育培训': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_08&industries=380&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '交通/物流/运输': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_09&industries=250&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '贸易/进出口': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_09&industries=160&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '航空/航天': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_09&industries=480&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '政务/公共服务': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_12&industries=390&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '农林牧渔': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_12&industries=410&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e',\n",
       " '其他行业': '/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_12&industries=400&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e'}"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# A-2 扩张 行业 ?  \n",
    "\n",
    "# 先取特定元素, 精准打击其子后辈\n",
    "主要元素 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')\n",
    "# 预期是一个元素的列表？\n",
    "print (主要元素)\n",
    "print (主要元素[0])\n",
    "print (主要元素[0].xpath('//dt[@class=\"search-title\"]'))\n",
    "\n",
    "list_search_title = 主要元素[0].xpath('//dt[@class=\"search-title\"]')\n",
    "for x in list_search_title:\n",
    "    print (x.text)\n",
    "    \n",
    "list_search_dd = 主要元素[0].xpath('//dt[@class=\"search-title\"]/following-sibling::dd')\n",
    "for x in list_search_dd:\n",
    "    print (x)  \n",
    "    \n",
    "\n",
    "行业数据选择器链结 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')[0] \\\n",
    "                    .xpath('//dt[@class=\"search-title\"]/following-sibling::dd')[1] \\\n",
    "                    .xpath('//div[contains(@class,\"sub-industry\")]/a/@href')\n",
    "               \n",
    "行业数据选择器链结\n",
    "\n",
    "# 但我们需要知道这些选择器链结, 对映到什麽数据\n",
    "行业数据选择器链结 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')[0] \\\n",
    "                    .xpath('//dt[@class=\"search-title\"]/following-sibling::dd')[1] \\\n",
    "                    .xpath('//div[contains(@class,\"sub-industry\")]/a')\n",
    "行业数据选择器链结\n",
    "\n",
    "#[ x.xpath(\"a/@href\")[0] for x in 公司数据选择器链结]\n",
    "#[ x.xpath(\"a/text()\")[0] for x in 公司数据选择器链结]\n",
    "行业数据选择器链结 = { x.xpath(\"a/text()\")[0]:x.xpath(\"a/@href\")[0] for x in 行业数据选择器链结}\n",
    "行业数据选择器链结"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_01&industries=040&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_01&industries=420&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_01&industries=010&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_01&industries=030&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_02&industries=050&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_02&industries=060&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_02&industries=020&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_03&industries=080&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_03&industries=100&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_03&industries=090&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=130&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=140&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=150&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=430&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_04&industries=500&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=190&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=240&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=200&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=210&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=220&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=460&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_05&industries=470&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=350&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=360&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=180&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=370&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_06&industries=340&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_10&industries=270&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_10&industries=280&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_10&industries=290&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=330&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=310&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=320&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=300&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_11&industries=490&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=120&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=110&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=440&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=450&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=230&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=260&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_07&industries=510&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_08&industries=070&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_08&industries=170&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_08&industries=380&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_09&industries=250&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_09&industries=160&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_09&industries=480&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_12&industries=390&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_12&industries=410&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=155&ckid=0d6aaf426d567653&subIndustry=&industryType=industry_12&industries=400&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e', fragment='')]"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from urllib.parse import urlparse, parse_qs\n",
    "[ urlparse(x) for x in 行业数据选择器链结.values()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 51 entries, 0 to 50\n",
      "Data columns (total 6 columns):\n",
      " #   Column    Non-Null Count  Dtype \n",
      "---  ------    --------------  ----- \n",
      " 0   scheme    51 non-null     object\n",
      " 1   netloc    51 non-null     object\n",
      " 2   path      51 non-null     object\n",
      " 3   params    51 non-null     object\n",
      " 4   query     51 non-null     object\n",
      " 5   fragment  51 non-null     object\n",
      "dtypes: object(6)\n",
      "memory usage: 2.5+ KB\n",
      "scheme       1\n",
      "netloc       1\n",
      "path         1\n",
      "params       1\n",
      "query       51\n",
      "fragment     1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>scheme</th>\n",
       "      <th>netloc</th>\n",
       "      <th>path</th>\n",
       "      <th>params</th>\n",
       "      <th>query</th>\n",
       "      <th>fragment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=c8f406abef58e2f1&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  scheme netloc       path params  \\\n",
       "0                /zhaopin/          \n",
       "\n",
       "                                               query fragment  \n",
       "0  init=-1&headckid=c8f406abef58e2f1&flushckid=1&...           "
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "df = pd.DataFrame([ urlparse(x) for x in 行业数据选择器链结.values()])\n",
    "df.info()\n",
    "print(df.nunique())\n",
    "df.head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init              1\n",
      "headckid          1\n",
      "flushckid         1\n",
      "fromSearchBtn     1\n",
      "compTag           1\n",
      "ckid              1\n",
      "industryType     12\n",
      "industries       51\n",
      "keyword           1\n",
      "siTag             1\n",
      "d_sfrom           1\n",
      "d_ckId            1\n",
      "d_curPage         1\n",
      "d_pageSize        1\n",
      "d_headId          1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>keyword</th>\n",
       "      <th>industryType</th>\n",
       "      <th>industries</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_01</td>\n",
       "      <td>040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_01</td>\n",
       "      <td>420</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_01</td>\n",
       "      <td>010</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_01</td>\n",
       "      <td>030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_02</td>\n",
       "      <td>050</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_02</td>\n",
       "      <td>060</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_02</td>\n",
       "      <td>020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_03</td>\n",
       "      <td>080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_03</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_03</td>\n",
       "      <td>090</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_04</td>\n",
       "      <td>130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_04</td>\n",
       "      <td>140</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_04</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_04</td>\n",
       "      <td>430</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_04</td>\n",
       "      <td>500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_05</td>\n",
       "      <td>190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_05</td>\n",
       "      <td>240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_05</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_05</td>\n",
       "      <td>210</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_05</td>\n",
       "      <td>220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_05</td>\n",
       "      <td>460</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_05</td>\n",
       "      <td>470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_06</td>\n",
       "      <td>350</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_06</td>\n",
       "      <td>360</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_06</td>\n",
       "      <td>180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_06</td>\n",
       "      <td>370</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_06</td>\n",
       "      <td>340</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_10</td>\n",
       "      <td>270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_10</td>\n",
       "      <td>280</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_10</td>\n",
       "      <td>290</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_11</td>\n",
       "      <td>330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_11</td>\n",
       "      <td>310</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_11</td>\n",
       "      <td>320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_11</td>\n",
       "      <td>300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_11</td>\n",
       "      <td>490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_07</td>\n",
       "      <td>120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_07</td>\n",
       "      <td>110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_07</td>\n",
       "      <td>440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_07</td>\n",
       "      <td>450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_07</td>\n",
       "      <td>230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_07</td>\n",
       "      <td>260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_07</td>\n",
       "      <td>510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_08</td>\n",
       "      <td>070</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_08</td>\n",
       "      <td>170</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_08</td>\n",
       "      <td>380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_09</td>\n",
       "      <td>250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_09</td>\n",
       "      <td>160</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_09</td>\n",
       "      <td>480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_12</td>\n",
       "      <td>390</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_12</td>\n",
       "      <td>410</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>用户体验</td>\n",
       "      <td>industry_12</td>\n",
       "      <td>400</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   keyword industryType industries\n",
       "0     用户体验  industry_01        040\n",
       "1     用户体验  industry_01        420\n",
       "2     用户体验  industry_01        010\n",
       "3     用户体验  industry_01        030\n",
       "4     用户体验  industry_02        050\n",
       "5     用户体验  industry_02        060\n",
       "6     用户体验  industry_02        020\n",
       "7     用户体验  industry_03        080\n",
       "8     用户体验  industry_03        100\n",
       "9     用户体验  industry_03        090\n",
       "10    用户体验  industry_04        130\n",
       "11    用户体验  industry_04        140\n",
       "12    用户体验  industry_04        150\n",
       "13    用户体验  industry_04        430\n",
       "14    用户体验  industry_04        500\n",
       "15    用户体验  industry_05        190\n",
       "16    用户体验  industry_05        240\n",
       "17    用户体验  industry_05        200\n",
       "18    用户体验  industry_05        210\n",
       "19    用户体验  industry_05        220\n",
       "20    用户体验  industry_05        460\n",
       "21    用户体验  industry_05        470\n",
       "22    用户体验  industry_06        350\n",
       "23    用户体验  industry_06        360\n",
       "24    用户体验  industry_06        180\n",
       "25    用户体验  industry_06        370\n",
       "26    用户体验  industry_06        340\n",
       "27    用户体验  industry_10        270\n",
       "28    用户体验  industry_10        280\n",
       "29    用户体验  industry_10        290\n",
       "30    用户体验  industry_11        330\n",
       "31    用户体验  industry_11        310\n",
       "32    用户体验  industry_11        320\n",
       "33    用户体验  industry_11        300\n",
       "34    用户体验  industry_11        490\n",
       "35    用户体验  industry_07        120\n",
       "36    用户体验  industry_07        110\n",
       "37    用户体验  industry_07        440\n",
       "38    用户体验  industry_07        450\n",
       "39    用户体验  industry_07        230\n",
       "40    用户体验  industry_07        260\n",
       "41    用户体验  industry_07        510\n",
       "42    用户体验  industry_08        070\n",
       "43    用户体验  industry_08        170\n",
       "44    用户体验  industry_08        380\n",
       "45    用户体验  industry_09        250\n",
       "46    用户体验  industry_09        160\n",
       "47    用户体验  industry_09        480\n",
       "48    用户体验  industry_12        390\n",
       "49    用户体验  industry_12        410\n",
       "50    用户体验  industry_12        400"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_qs = pd.DataFrame([{k:v[0] for k,v in parse_qs(x).items()} for x in df['query'] ])\n",
    "print (df_qs.nunique())\n",
    "df_qs.head()\n",
    "df_qs[['keyword','industryType','industries']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_01',\n",
       "  'industries': '040',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_01',\n",
       "  'industries': '420',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_01',\n",
       "  'industries': '010',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_01',\n",
       "  'industries': '030',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_02',\n",
       "  'industries': '050',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_02',\n",
       "  'industries': '060',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_02',\n",
       "  'industries': '020',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_03',\n",
       "  'industries': '080',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_03',\n",
       "  'industries': '100',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_03',\n",
       "  'industries': '090',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_04',\n",
       "  'industries': '130',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_04',\n",
       "  'industries': '140',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_04',\n",
       "  'industries': '150',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_04',\n",
       "  'industries': '430',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_04',\n",
       "  'industries': '500',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_05',\n",
       "  'industries': '190',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_05',\n",
       "  'industries': '240',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_05',\n",
       "  'industries': '200',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_05',\n",
       "  'industries': '210',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_05',\n",
       "  'industries': '220',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_05',\n",
       "  'industries': '460',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_05',\n",
       "  'industries': '470',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_06',\n",
       "  'industries': '350',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_06',\n",
       "  'industries': '360',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_06',\n",
       "  'industries': '180',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_06',\n",
       "  'industries': '370',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_06',\n",
       "  'industries': '340',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_10',\n",
       "  'industries': '270',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_10',\n",
       "  'industries': '280',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_10',\n",
       "  'industries': '290',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_11',\n",
       "  'industries': '330',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_11',\n",
       "  'industries': '310',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_11',\n",
       "  'industries': '320',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_11',\n",
       "  'industries': '300',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_11',\n",
       "  'industries': '490',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_07',\n",
       "  'industries': '120',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_07',\n",
       "  'industries': '110',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_07',\n",
       "  'industries': '440',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_07',\n",
       "  'industries': '450',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_07',\n",
       "  'industries': '230',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_07',\n",
       "  'industries': '260',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_07',\n",
       "  'industries': '510',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_08',\n",
       "  'industries': '070',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_08',\n",
       "  'industries': '170',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_08',\n",
       "  'industries': '380',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_09',\n",
       "  'industries': '250',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_09',\n",
       "  'industries': '160',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_09',\n",
       "  'industries': '480',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_12',\n",
       "  'industries': '390',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_12',\n",
       "  'industries': '410',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'},\n",
       " {'init': '-1',\n",
       "  'headckid': 'c8f406abef58e2f1',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'compTag': '155',\n",
       "  'ckid': '0d6aaf426d567653',\n",
       "  'industryType': 'industry_12',\n",
       "  'industries': '400',\n",
       "  'keyword': '用户体验',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '02df37f1add833b3345742bf157ed71e',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '02df37f1add833b3345742bf157ed71e'}]"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 经过整合后（合二为一）\n",
    "列表暫存 = [] # list()\n",
    "for q in df['query']: \n",
    "    字典暫存 = dict()\n",
    "    for k,v in parse_qs(q).items(): # for 鍵,值 in 字典.items():\n",
    "        字典暫存.update({k:v[0]})\n",
    "    列表暫存.append(字典暫存)\n",
    "列表暫存"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['155'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}\n",
      "{'互联网/电商': '040', '游戏产业': '420', '计算机软件': '010', 'IT服务': '030', '电子/芯片/半导体': '050', '通信业': '060', '计算机/网络设备': '020', '房地产/建筑': '080', '规划/设计/装潢': '100', '房地产服务': '090', '银行': '130', '保险': '140', '基金/证券/投资': '150', '会计/审计': '430', '信托/担保/拍卖': '500', '快消品': '190', '批发零售': '240', '服装纺织': '200', '家具/家电': '210', '办公设备': '220', '奢侈品/收藏品': '460', '珠宝/玩具/工艺品': '470', '汽车/摩托车': '350', '机械/机电/重工': '360', '印刷/包装/造纸': '180', '原材料加工': '370', '仪器/电气/自动化': '340', '制药/生物工程': '270', '医疗/保健/美容': '280', '医疗器械': '290', '能源/水利': '330', '石油/化工': '310', '采掘/冶炼/矿产': '320', '环保': '300', '新能源': '490', '专业服务': '120', '中介服务': '110', '外包服务': '440', '检测/认证': '450', '餐饮/酒旅/服务': '230', '文体娱乐': '260', '租赁服务': '510', '广告/市场/会展': '070', '影视文化': '170', '教育培训': '380', '交通/物流/运输': '250', '贸易/进出口': '160', '航空/航天': '480', '政务/公共服务': '390', '农林牧渔': '410', '其他行业': '400'}\n"
     ]
    }
   ],
   "source": [
    "# 建构 参数模板 及 字典_compTag\n",
    "def parse_url_qs_for_compTag (url):\n",
    "    six_parts = urlparse(url) \n",
    "    out = parse_qs(six_parts.query)\n",
    "    return (out)\n",
    "\n",
    "\n",
    "参数模板 = parse_url_qs_for_compTag(list(行业数据选择器链结.values())[0])\n",
    "print(参数模板)\n",
    "\n",
    "[ parse_url_qs_for_compTag(x)['industries'][0] for x in 行业数据选择器链结.values()]\n",
    "\n",
    "字典_compTag = { k:parse_url_qs_for_compTag(v)['industries'][0] for k,v in 行业数据选择器链结.items()}\n",
    "print (字典_compTag)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'互联网/电商': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['040'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '游戏产业': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['420'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '计算机软件': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['010'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, 'IT服务': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['030'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '电子/芯片/半导体': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['050'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '通信业': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['060'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '计算机/网络设备': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['020'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '房地产/建筑': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['080'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '规划/设计/装潢': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['100'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '房地产服务': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['090'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '银行': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['130'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '保险': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['140'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '基金/证券/投资': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['150'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '会计/审计': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['430'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '信托/担保/拍卖': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['500'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '快消品': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['190'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '批发零售': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['240'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '服装纺织': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['200'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '家具/家电': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['210'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '办公设备': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['220'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '奢侈品/收藏品': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['460'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '珠宝/玩具/工艺品': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['470'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '汽车/摩托车': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['350'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '机械/机电/重工': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['360'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '印刷/包装/造纸': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['180'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '原材料加工': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['370'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '仪器/电气/自动化': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['340'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '制药/生物工程': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['270'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '医疗/保健/美容': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['280'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '医疗器械': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['290'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '能源/水利': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['330'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '石油/化工': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['310'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '采掘/冶炼/矿产': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['320'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '环保': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['300'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '新能源': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['490'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '专业服务': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['120'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '中介服务': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['110'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '外包服务': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['440'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '检测/认证': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['450'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '餐饮/酒旅/服务': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['230'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '文体娱乐': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['260'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '租赁服务': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['510'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '广告/市场/会展': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['070'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '影视文化': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['170'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '教育培训': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['380'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '交通/物流/运输': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['250'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '贸易/进出口': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['160'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '航空/航天': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['480'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '政务/公共服务': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['390'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '农林牧渔': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['410'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}, '其他行业': {'init': ['-1'], 'headckid': ['c8f406abef58e2f1'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'compTag': ['400'], 'ckid': ['0d6aaf426d567653'], 'industryType': ['industry_01'], 'industries': ['040'], 'keyword': ['用户体验'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['02df37f1add833b3345742bf157ed71e'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['02df37f1add833b3345742bf157ed71e']}}\n"
     ]
    }
   ],
   "source": [
    "def 参数模板生成(compTag , keyword ):\n",
    "    参数 = 参数模板.copy()\n",
    "    参数['compTag'] = compTag\n",
    "    参数['keyword'] = keyword\n",
    "    return (参数)\n",
    "\n",
    "参数_compTag_用户体验 = { k:参数模板生成(compTag = [v], keyword = ['用户体验']) for k,v in 字典_compTag.items()}\n",
    "print(参数_compTag_用户体验)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'https://www.liepin.com/zhaopin/?init=-1&headckid=c8f406abef58e2f1&flushckid=1&fromSearchBtn=2&compTag=190&ckid=0d6aaf426d567653&industryType=industry_01&industries=040&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C&siTag=1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=02df37f1add833b3345742bf157ed71e&d_curPage=0&d_pageSize=40&d_headId=02df37f1add833b3345742bf157ed71e'"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 多个页面的测试\n",
    "url = \"https://www.liepin.com/zhaopin/\"\n",
    "session = HTMLSession()\n",
    "payload = 参数_compTag_用户体验['快消品']\n",
    "r = session.get( url, params = payload)\n",
    "r.url"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "#  简化 单一页面爬+解析\n",
    "session = HTMLSession()\n",
    "\n",
    "def requests_liepin( url, params):\n",
    "    r = session.get( url , params = payload)\n",
    "\n",
    "    # 先取特定元素, 精准打击其子后辈\n",
    "    主要元素 = r.html.xpath( '//ul[@class=\"sojob-list\"]/li')\n",
    "\n",
    "    # 作为xpath字典，键为我要抓的牛肉名称，值为xpath\n",
    "    dict_xpaths={ \n",
    "        'text': {\n",
    "            'edu':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]',\n",
    "            '经验':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]/following-sibling::span',\n",
    "            '薪水':    '//div[contains(@class,\"job-info\")]/p/span[@class=\"text-warning\"]', \n",
    "            '时间':    '//div[contains(@class,\"job-info\")]/p/time/@title', \n",
    "            '职称':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "            '行业地点': '//div[contains(@class,\"job-info\")]/p/a',\n",
    "            '行业名称': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a', \n",
    "        },\n",
    "        'text_content': {\n",
    "        },\n",
    "        'href': {\n",
    "            '链结':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "            '行业URL': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a', \n",
    "        }\n",
    "    }\n",
    "\n",
    "    def get_e_text_content(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [e.xpath(_xpath_)[0].lxml.text_content() for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    def get_e_text(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [\"\".join([x.strip() if type(x) is str else x.text.strip() for x in e.xpath(_xpath_)]) for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    def get_e_href(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [list(e.xpath(_xpath_, first=True).absolute_links)[0] \\\n",
    "                   if len(e.xpath(_xpath_, first=True).absolute_links) >= 1  \\\n",
    "                   else \"\" for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    # 只对主要元素下进行.xpath取值\n",
    "    数据字典 = dict()\n",
    "\n",
    "    数据字典 = {k:get_e_text_content(v) for k,v in dict_xpaths['text_content'].items()}\n",
    "    数据字典.update({k:get_e_text(v) for k,v in dict_xpaths['text'].items()})\n",
    "    数据字典.update({k:get_e_href(v) for k,v in dict_xpaths['href'].items()})\n",
    "\n",
    "    数据 = pd.DataFrame(数据字典)\n",
    "    return (数据)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>edu</th>\n",
       "      <th>经验</th>\n",
       "      <th>薪水</th>\n",
       "      <th>时间</th>\n",
       "      <th>职称</th>\n",
       "      <th>行业地点</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>链结</th>\n",
       "      <th>行业URL</th>\n",
       "      <th>热门行业类型</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>10-18k·13薪</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>电商市场营销BD</td>\n",
       "      <td>广州-天河区</td>\n",
       "      <td>墨尔(广州)教育科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927307613.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9532712/</td>\n",
       "      <td>计算机软件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>K12渠道拓展总监</td>\n",
       "      <td>北京</td>\n",
       "      <td>北京点石经纬科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1926925555.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8327598/</td>\n",
       "      <td>计算机软件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>电商运营专员</td>\n",
       "      <td>上海-闵行区</td>\n",
       "      <td>华硕电脑（上海）有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1926477641.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8134688/</td>\n",
       "      <td>计算机软件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>招聘专员</td>\n",
       "      <td>上海-闵行区</td>\n",
       "      <td>华硕电脑（上海）有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1925975821.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8134688/</td>\n",
       "      <td>计算机软件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>5-10k·12薪</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>执业药师内容研发专员</td>\n",
       "      <td>广州-岗顶</td>\n",
       "      <td>广州寄锦教育科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1918851369.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8311755/</td>\n",
       "      <td>计算机软件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15-30k·13薪</td>\n",
       "      <td>2020年04月23日</td>\n",
       "      <td>电商广告产品经理 (MJ002836)</td>\n",
       "      <td>广州-番禺区</td>\n",
       "      <td>欢聚集团</td>\n",
       "      <td>https://www.liepin.com/job/1927214861.shtml</td>\n",
       "      <td>https://www.liepin.com/company/930104/</td>\n",
       "      <td>印刷/包装/造纸</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>16-32k·13薪</td>\n",
       "      <td>2020年04月23日</td>\n",
       "      <td>高级主播运营-HAGO (MJ002831)</td>\n",
       "      <td>广州-番禺区</td>\n",
       "      <td>欢聚集团</td>\n",
       "      <td>https://www.liepin.com/job/1927171343.shtml</td>\n",
       "      <td>https://www.liepin.com/company/930104/</td>\n",
       "      <td>印刷/包装/造纸</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15-30k·13薪</td>\n",
       "      <td>2020年04月23日</td>\n",
       "      <td>产品经理（内容分发/推荐策略）-HAGO (MJ002829)</td>\n",
       "      <td>广州-番禺区</td>\n",
       "      <td>欢聚集团</td>\n",
       "      <td>https://www.liepin.com/job/1927159049.shtml</td>\n",
       "      <td>https://www.liepin.com/company/930104/</td>\n",
       "      <td>印刷/包装/造纸</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15-25k·13薪</td>\n",
       "      <td>2020年04月23日</td>\n",
       "      <td>运维开发工程师 (MJ002827)</td>\n",
       "      <td>广州-番禺区</td>\n",
       "      <td>欢聚集团</td>\n",
       "      <td>https://www.liepin.com/job/1927144527.shtml</td>\n",
       "      <td>https://www.liepin.com/company/930104/</td>\n",
       "      <td>印刷/包装/造纸</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>15-30k·13薪</td>\n",
       "      <td>2020年04月23日</td>\n",
       "      <td>城市经理 (MJ001545)</td>\n",
       "      <td>广州-番禺区</td>\n",
       "      <td>欢聚集团</td>\n",
       "      <td>https://www.liepin.com/job/1927136617.shtml</td>\n",
       "      <td>https://www.liepin.com/company/930104/</td>\n",
       "      <td>印刷/包装/造纸</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>240 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      edu     经验          薪水           时间                               职称  \\\n",
       "0   大专及以上   1-3年  10-18k·13薪  2020年04月24日                         电商市场营销BD   \n",
       "1   大专及以上  5-10年  20-30k·12薪  2020年04月24日                        K12渠道拓展总监   \n",
       "2   本科及以上   经验不限          面议  2020年04月24日                           电商运营专员   \n",
       "3    统招本科   1-3年          面议  2020年04月24日                             招聘专员   \n",
       "4    统招本科   经验不限   5-10k·12薪  2020年04月24日                       执业药师内容研发专员   \n",
       "..    ...    ...         ...          ...                              ...   \n",
       "35  本科及以上   3-5年  15-30k·13薪  2020年04月23日              电商广告产品经理 (MJ002836)   \n",
       "36  本科及以上   3-5年  16-32k·13薪  2020年04月23日           高级主播运营-HAGO (MJ002831)   \n",
       "37  本科及以上   3-5年  15-30k·13薪  2020年04月23日  产品经理（内容分发/推荐策略）-HAGO (MJ002829)   \n",
       "38  本科及以上   3-5年  15-25k·13薪  2020年04月23日               运维开发工程师 (MJ002827)   \n",
       "39  本科及以上   1-3年  15-30k·13薪  2020年04月23日                  城市经理 (MJ001545)   \n",
       "\n",
       "      行业地点            行业名称                                           链结  \\\n",
       "0   广州-天河区  墨尔(广州)教育科技有限公司  https://www.liepin.com/job/1927307613.shtml   \n",
       "1       北京    北京点石经纬科技有限公司  https://www.liepin.com/job/1926925555.shtml   \n",
       "2   上海-闵行区    华硕电脑（上海）有限公司  https://www.liepin.com/job/1926477641.shtml   \n",
       "3   上海-闵行区    华硕电脑（上海）有限公司  https://www.liepin.com/job/1925975821.shtml   \n",
       "4    广州-岗顶    广州寄锦教育科技有限公司  https://www.liepin.com/job/1918851369.shtml   \n",
       "..     ...             ...                                          ...   \n",
       "35  广州-番禺区            欢聚集团  https://www.liepin.com/job/1927214861.shtml   \n",
       "36  广州-番禺区            欢聚集团  https://www.liepin.com/job/1927171343.shtml   \n",
       "37  广州-番禺区            欢聚集团  https://www.liepin.com/job/1927159049.shtml   \n",
       "38  广州-番禺区            欢聚集团  https://www.liepin.com/job/1927144527.shtml   \n",
       "39  广州-番禺区            欢聚集团  https://www.liepin.com/job/1927136617.shtml   \n",
       "\n",
       "                                      行业URL    热门行业类型  \n",
       "0   https://www.liepin.com/company/9532712/     计算机软件  \n",
       "1   https://www.liepin.com/company/8327598/     计算机软件  \n",
       "2   https://www.liepin.com/company/8134688/     计算机软件  \n",
       "3   https://www.liepin.com/company/8134688/     计算机软件  \n",
       "4   https://www.liepin.com/company/8311755/     计算机软件  \n",
       "..                                      ...       ...  \n",
       "35   https://www.liepin.com/company/930104/  印刷/包装/造纸  \n",
       "36   https://www.liepin.com/company/930104/  印刷/包装/造纸  \n",
       "37   https://www.liepin.com/company/930104/  印刷/包装/造纸  \n",
       "38   https://www.liepin.com/company/930104/  印刷/包装/造纸  \n",
       "39   https://www.liepin.com/company/930104/  印刷/包装/造纸  \n",
       "\n",
       "[240 rows x 10 columns]"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url = \"https://www.liepin.com/zhaopin/\"\n",
    "\n",
    "list_df = list()\n",
    "for k,v in 参数_compTag_用户体验.items():\n",
    "    payload = v\n",
    "    df = requests_liepin( url, params = payload)\n",
    "    df = df.assign (热门行业类型 = k)    \n",
    "    list_df.append(df)\n",
    "\n",
    "df_all = pd.concat(list_df)\n",
    "df_all"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_all.to_excel(\"20春_Web数据挖掘_week06_liepin_各热门行业类型.xlsx\", sheet_name=\"搜查结果\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 城市"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<Element 'div' class=('search-conditions',) data-selector='search-conditions'>]\n",
      "<Element 'div' class=('search-conditions',) data-selector='search-conditions'>\n",
      "[<Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>]\n",
      "行业：\n",
      "城市：\n",
      "薪资：\n",
      "更多：\n",
      "<Element 'dd' class=('short-dd', 'select-industry') data-param='industries'>\n",
      "<Element 'dd' data-param='city'>\n",
      "<Element 'dd' data-param='salary'>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-time')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-jobkind')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-compscale')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-compkind')>\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'北京': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=010&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '上海': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '广州': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=050020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '深圳': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=050090&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '天津': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=030&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '苏州': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=060080&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '重庆': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=040&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '南京': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=060020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '杭州': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=070020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '大连': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=210040&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '成都': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=280020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d',\n",
       " '武汉': '/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=170020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d'}"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# A-2 扩张 城市?  \n",
    "\n",
    "# 先取特定元素, 精准打击其子后辈\n",
    "主要元素 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')\n",
    "# 预期是一个元素的列表？\n",
    "print (主要元素)\n",
    "print (主要元素[0])\n",
    "print (主要元素[0].xpath('//dt[@class=\"search-title\"]'))\n",
    "\n",
    "list_search_title = 主要元素[0].xpath('//dt[@class=\"search-title\"]')\n",
    "for x in list_search_title[1:]:\n",
    "    print (x.text)\n",
    "    \n",
    "list_search_dd = 主要元素[0].xpath('//dt[@class=\"search-title\"]/following-sibling::dd')\n",
    "for x in list_search_dd[1:]:\n",
    "    print (x)  \n",
    "    \n",
    "\n",
    "城市数据选择器链结 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')[0] \\\n",
    "                    .xpath('//dt[@class=\"search-title\"]/following-sibling::dd')[2] \\\n",
    "                    .xpath('//dd[contains(@data-param,\"city\")]/a[@class]/@href')\n",
    "               \n",
    "城市数据选择器链结\n",
    "\n",
    "# 但我们需要知道这些选择器链结, 对映到什麽数据\n",
    "城市数据选择器链结 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')[0] \\\n",
    "                    .xpath('//dt[@class=\"search-title\"]/following-sibling::dd')[2] \\\n",
    "                    .xpath('//dd[contains(@data-param,\"city\")]/a[@class]')\n",
    "城市数据选择器链结\n",
    "\n",
    "#[ x.xpath(\"a/@href\")[0] for x in 公司数据选择器链结]\n",
    "#[ x.xpath(\"a/text()\")[0] for x in 公司数据选择器链结]\n",
    "城市数据选择器链结 = { x.xpath(\"a/text()\")[0]:x.xpath(\"a/@href\")[0] for x in 城市数据选择器链结[1:]}\n",
    "城市数据选择器链结"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=010&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=050020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=050090&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=030&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=060080&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=040&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=060020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=070020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=210040&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=280020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment=''),\n",
       " ParseResult(scheme='', netloc='', path='/zhaopin/', params='', query='init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=170020&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d', fragment='')]"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from urllib.parse import urlparse, parse_qs\n",
    "[ urlparse(x) for x in 城市数据选择器链结.values()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 12 entries, 0 to 11\n",
      "Data columns (total 6 columns):\n",
      " #   Column    Non-Null Count  Dtype \n",
      "---  ------    --------------  ----- \n",
      " 0   scheme    12 non-null     object\n",
      " 1   netloc    12 non-null     object\n",
      " 2   path      12 non-null     object\n",
      " 3   params    12 non-null     object\n",
      " 4   query     12 non-null     object\n",
      " 5   fragment  12 non-null     object\n",
      "dtypes: object(6)\n",
      "memory usage: 704.0+ bytes\n",
      "scheme       1\n",
      "netloc       1\n",
      "path         1\n",
      "params       1\n",
      "query       12\n",
      "fragment     1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>scheme</th>\n",
       "      <th>netloc</th>\n",
       "      <th>path</th>\n",
       "      <th>params</th>\n",
       "      <th>query</th>\n",
       "      <th>fragment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;ckid=9622149657da3c8c&amp;headckid=9622149...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  scheme netloc       path params  \\\n",
       "0                /zhaopin/          \n",
       "\n",
       "                                               query fragment  \n",
       "0  init=-1&ckid=9622149657da3c8c&headckid=9622149...           "
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "df = pd.DataFrame([ urlparse(x) for x in 城市数据选择器链结.values()])\n",
    "df.info()\n",
    "print(df.nunique())\n",
    "df.head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init              1\n",
      "ckid              1\n",
      "headckid          1\n",
      "flushckid         1\n",
      "fromSearchBtn     1\n",
      "dqs              12\n",
      "siTag             1\n",
      "d_sfrom           1\n",
      "d_ckId            1\n",
      "d_curPage         1\n",
      "d_pageSize        1\n",
      "d_headId          1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ckid</th>\n",
       "      <th>dqs</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>010</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>050020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>050090</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>060080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>060020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>070020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>210040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>280020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>9622149657da3c8c</td>\n",
       "      <td>170020</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                ckid     dqs\n",
       "0   9622149657da3c8c     010\n",
       "1   9622149657da3c8c     020\n",
       "2   9622149657da3c8c  050020\n",
       "3   9622149657da3c8c  050090\n",
       "4   9622149657da3c8c     030\n",
       "5   9622149657da3c8c  060080\n",
       "6   9622149657da3c8c     040\n",
       "7   9622149657da3c8c  060020\n",
       "8   9622149657da3c8c  070020\n",
       "9   9622149657da3c8c  210040\n",
       "10  9622149657da3c8c  280020\n",
       "11  9622149657da3c8c  170020"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_qs = pd.DataFrame([{k:v[0] for k,v in parse_qs(x).items()} for x in df['query'] ])\n",
    "print (df_qs.nunique())\n",
    "df_qs.head()\n",
    "df_qs[['ckid','dqs']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '010',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '020',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '050020',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '050090',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '030',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '060080',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '040',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '060020',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '070020',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '210040',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '280020',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'},\n",
       " {'init': '-1',\n",
       "  'ckid': '9622149657da3c8c',\n",
       "  'headckid': '9622149657da3c8c',\n",
       "  'flushckid': '1',\n",
       "  'fromSearchBtn': '2',\n",
       "  'dqs': '170020',\n",
       "  'siTag': '1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw',\n",
       "  'd_sfrom': 'search_unknown',\n",
       "  'd_ckId': '267a80879c974199bb66bd98c5b1d66d',\n",
       "  'd_curPage': '0',\n",
       "  'd_pageSize': '40',\n",
       "  'd_headId': '267a80879c974199bb66bd98c5b1d66d'}]"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "列表暫存 = [] # list()\n",
    "for q in df['query']: \n",
    "    字典暫存 = dict()\n",
    "    for k,v in parse_qs(q).items(): # for 鍵,值 in 字典.items():\n",
    "        字典暫存.update({k:v[0]})\n",
    "    列表暫存.append(字典暫存)\n",
    "列表暫存"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d']}\n",
      "{'北京': '010', '上海': '020', '广州': '050020', '深圳': '050090', '天津': '030', '苏州': '060080', '重庆': '040', '南京': '060020', '杭州': '070020', '大连': '210040', '成都': '280020', '武汉': '170020'}\n"
     ]
    }
   ],
   "source": [
    "# 建构 参数模板 及 字典_compTag\n",
    "def parse_url_qs_for_compTag (url):\n",
    "    six_parts = urlparse(url) \n",
    "    out = parse_qs(six_parts.query)\n",
    "    return (out)\n",
    "\n",
    "参数模板 = parse_url_qs_for_compTag(list(城市数据选择器链结.values())[0])\n",
    "print(参数模板)\n",
    "\n",
    "[ parse_url_qs_for_compTag(x)['dqs'][0] for x in 城市数据选择器链结.values()]\n",
    "\n",
    "字典_compTag = { k:parse_url_qs_for_compTag(v)['dqs'][0] for k,v in 城市数据选择器链结.items()}\n",
    "print (字典_compTag)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'北京': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['010'], 'keyword': ['用户体验']}, '上海': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['020'], 'keyword': ['用户体验']}, '广州': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['050020'], 'keyword': ['用户体验']}, '深圳': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['050090'], 'keyword': ['用户体验']}, '天津': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['030'], 'keyword': ['用户体验']}, '苏州': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['060080'], 'keyword': ['用户体验']}, '重庆': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['040'], 'keyword': ['用户体验']}, '南京': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['060020'], 'keyword': ['用户体验']}, '杭州': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['070020'], 'keyword': ['用户体验']}, '大连': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['210040'], 'keyword': ['用户体验']}, '成都': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['280020'], 'keyword': ['用户体验']}, '武汉': {'init': ['-1'], 'ckid': ['9622149657da3c8c'], 'headckid': ['9622149657da3c8c'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'dqs': ['010'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['267a80879c974199bb66bd98c5b1d66d'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['267a80879c974199bb66bd98c5b1d66d'], 'compTag': ['170020'], 'keyword': ['用户体验']}}\n"
     ]
    }
   ],
   "source": [
    "# 建构 参数模板  \n",
    "def 参数模板生成(compTag , keyword ):\n",
    "    参数 = 参数模板.copy()\n",
    "    参数['compTag'] = compTag\n",
    "    参数['keyword'] = keyword\n",
    "    return (参数)\n",
    "\n",
    "参数_compTag_用户体验 = { k:参数模板生成(compTag = [v], keyword = ['用户体验']) for k,v in 字典_compTag.items()}\n",
    "print(参数_compTag_用户体验)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'https://www.liepin.com/zhaopin/?init=-1&ckid=9622149657da3c8c&headckid=9622149657da3c8c&flushckid=1&fromSearchBtn=2&dqs=010&siTag=1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=267a80879c974199bb66bd98c5b1d66d&d_curPage=0&d_pageSize=40&d_headId=267a80879c974199bb66bd98c5b1d66d&compTag=010&keyword=%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C'"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 多个页面准备测试 北京\n",
    "url = \"https://www.liepin.com/zhaopin/\"\n",
    "session = HTMLSession()\n",
    "payload = 参数_compTag_用户体验['北京']\n",
    "r = session.get( url, params = payload)\n",
    "r.url\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 简化\n",
    "session = HTMLSession()\n",
    "\n",
    "def requests_liepin( url, params):\n",
    "    r = session.get( url , params = payload)\n",
    "\n",
    "    # 先取特定元素, 精准打击其子后辈\n",
    "    主要元素 = r.html.xpath( '//ul[@class=\"sojob-list\"]/li')\n",
    "\n",
    "    # 作为xpath字典，键为我要抓的牛肉名称，值为xpath\n",
    "    dict_xpaths={ \n",
    "        'text': {\n",
    "            'edu':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]',\n",
    "            '经验':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]/following-sibling::span',\n",
    "            '薪水':    '//div[contains(@class,\"job-info\")]/p/span[@class=\"text-warning\"]', \n",
    "            '时间':    '//div[contains(@class,\"job-info\")]/p/time/@title', \n",
    "            '职称':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "            '公司地点': '//div[contains(@class,\"job-info\")]/p/a',\n",
    "            '公司名称': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a', \n",
    "        },\n",
    "        'text_content': {\n",
    "        },\n",
    "        'href': {\n",
    "            '链结':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "            '公司URL': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a', \n",
    "        }\n",
    "    }\n",
    "\n",
    "    def get_e_text_content(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [e.xpath(_xpath_)[0].lxml.text_content() for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    def get_e_text(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [\"\".join([x.strip() if type(x) is str else x.text.strip() for x in e.xpath(_xpath_)]) for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    def get_e_href(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [list(e.xpath(_xpath_, first=True).absolute_links)[0] \\\n",
    "                   if len(e.xpath(_xpath_, first=True).absolute_links) >= 1  \\\n",
    "                   else \"\" for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    # 只对主要元素下进行.xpath取值\n",
    "    数据字典 = dict()\n",
    "\n",
    "    数据字典 = {k:get_e_text_content(v) for k,v in dict_xpaths['text_content'].items()}\n",
    "    数据字典.update({k:get_e_text(v) for k,v in dict_xpaths['text'].items()})\n",
    "    数据字典.update({k:get_e_href(v) for k,v in dict_xpaths['href'].items()})\n",
    "\n",
    "    数据 = pd.DataFrame(数据字典)\n",
    "    #数据.to_excel(\"20春_Web数据挖掘_week03_liepin.xlsx\", sheet_name=\"搜查结果\")\n",
    "    return (数据)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>edu</th>\n",
       "      <th>经验</th>\n",
       "      <th>薪水</th>\n",
       "      <th>时间</th>\n",
       "      <th>职称</th>\n",
       "      <th>公司地点</th>\n",
       "      <th>公司名称</th>\n",
       "      <th>链结</th>\n",
       "      <th>公司URL</th>\n",
       "      <th>城市</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>10-18k·12薪</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>北京</td>\n",
       "      <td>北京质心教育科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927649159.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9370190/</td>\n",
       "      <td>北京</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>13-18k·12薪</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>资深编辑</td>\n",
       "      <td>北京</td>\n",
       "      <td>北京华樾教育科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927612705.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9086036/</td>\n",
       "      <td>北京</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>大专及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>K12渠道拓展总监</td>\n",
       "      <td>北京</td>\n",
       "      <td>北京点石经纬科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1926925555.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8327598/</td>\n",
       "      <td>北京</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>10-18k·12薪</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>北京</td>\n",
       "      <td>北京质心教育科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927743375.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9370190/</td>\n",
       "      <td>北京</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月23日</td>\n",
       "      <td>需求分析及运营架构师</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国电信股份有限公司北京研究院</td>\n",
       "      <td>https://www.liepin.com/job/1927477241.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8830303/</td>\n",
       "      <td>北京</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>12-20k·12薪</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>运维工程师</td>\n",
       "      <td>北京</td>\n",
       "      <td>科大讯飞</td>\n",
       "      <td>https://www.liepin.com/job/1927566793.shtml</td>\n",
       "      <td>https://www.liepin.com/company/4454894/</td>\n",
       "      <td>上海</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>13-18k·12薪</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>图像应用开发工程师</td>\n",
       "      <td>北京</td>\n",
       "      <td>凌云光技术</td>\n",
       "      <td>https://www.liepin.com/job/1927544987.shtml</td>\n",
       "      <td>https://www.liepin.com/company/7892331/</td>\n",
       "      <td>上海</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>云计算销售经理</td>\n",
       "      <td>北京</td>\n",
       "      <td>网宿科技</td>\n",
       "      <td>https://www.liepin.com/job/1927531339.shtml</td>\n",
       "      <td>https://www.liepin.com/company/1551043/</td>\n",
       "      <td>上海</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>7-15k·12薪</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>大客户销售经理</td>\n",
       "      <td></td>\n",
       "      <td>首都在线</td>\n",
       "      <td>https://www.liepin.com/job/1927530123.shtml</td>\n",
       "      <td>https://www.liepin.com/company/2750252/</td>\n",
       "      <td>上海</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月24日</td>\n",
       "      <td>公检法司/国安/军队/消防行业销售经理</td>\n",
       "      <td>北京</td>\n",
       "      <td>网宿科技</td>\n",
       "      <td>https://www.liepin.com/job/1927528025.shtml</td>\n",
       "      <td>https://www.liepin.com/company/1551043/</td>\n",
       "      <td>上海</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>80 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      edu     经验          薪水           时间                   职称 公司地点  \\\n",
       "0    统招本科   1-3年  10-18k·12薪  2020年04月25日                 产品经理   北京   \n",
       "1    统招本科  5-10年  13-18k·12薪  2020年04月24日                 资深编辑   北京   \n",
       "2   大专及以上  5-10年  20-30k·12薪  2020年04月24日            K12渠道拓展总监   北京   \n",
       "3   本科及以上   1-3年  10-18k·12薪  2020年04月24日                 产品经理   北京   \n",
       "4   本科及以上   3-5年          面议  2020年04月23日           需求分析及运营架构师   北京   \n",
       "..    ...    ...         ...          ...                  ...  ...   \n",
       "35  本科及以上   3-5年  12-20k·12薪  2020年04月24日                运维工程师   北京   \n",
       "36  本科及以上   1-3年  13-18k·12薪  2020年04月24日            图像应用开发工程师   北京   \n",
       "37  本科及以上   3-5年          面议  2020年04月24日              云计算销售经理   北京   \n",
       "38   统招本科   1-3年   7-15k·12薪  2020年04月24日              大客户销售经理        \n",
       "39  本科及以上  5-10年          面议  2020年04月24日  公检法司/国安/军队/消防行业销售经理   北京   \n",
       "\n",
       "               公司名称                                           链结  \\\n",
       "0      北京质心教育科技有限公司  https://www.liepin.com/job/1927649159.shtml   \n",
       "1      北京华樾教育科技有限公司  https://www.liepin.com/job/1927612705.shtml   \n",
       "2      北京点石经纬科技有限公司  https://www.liepin.com/job/1926925555.shtml   \n",
       "3      北京质心教育科技有限公司  https://www.liepin.com/job/1927743375.shtml   \n",
       "4   中国电信股份有限公司北京研究院  https://www.liepin.com/job/1927477241.shtml   \n",
       "..              ...                                          ...   \n",
       "35             科大讯飞  https://www.liepin.com/job/1927566793.shtml   \n",
       "36            凌云光技术  https://www.liepin.com/job/1927544987.shtml   \n",
       "37             网宿科技  https://www.liepin.com/job/1927531339.shtml   \n",
       "38             首都在线  https://www.liepin.com/job/1927530123.shtml   \n",
       "39             网宿科技  https://www.liepin.com/job/1927528025.shtml   \n",
       "\n",
       "                                      公司URL  城市  \n",
       "0   https://www.liepin.com/company/9370190/  北京  \n",
       "1   https://www.liepin.com/company/9086036/  北京  \n",
       "2   https://www.liepin.com/company/8327598/  北京  \n",
       "3   https://www.liepin.com/company/9370190/  北京  \n",
       "4   https://www.liepin.com/company/8830303/  北京  \n",
       "..                                      ...  ..  \n",
       "35  https://www.liepin.com/company/4454894/  上海  \n",
       "36  https://www.liepin.com/company/7892331/  上海  \n",
       "37  https://www.liepin.com/company/1551043/  上海  \n",
       "38  https://www.liepin.com/company/2750252/  上海  \n",
       "39  https://www.liepin.com/company/1551043/  上海  \n",
       "\n",
       "[80 rows x 10 columns]"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 多个页面\n",
    "url = \"https://www.liepin.com/zhaopin/\"\n",
    "\n",
    "list_df = list()\n",
    "for k,v in 参数_compTag_用户体验.items():\n",
    "    payload = v\n",
    "    df = requests_liepin( url, params = payload)\n",
    "    df = df.assign (城市 = k)    \n",
    "    list_df.append(df)\n",
    "\n",
    "df_all = pd.concat(list_df)\n",
    "df_all"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_all.to_excel(\"20春_Web数据挖掘_week06_liepin_城市.xlsx\", sheet_name=\"搜查结果\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
